home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 1 (Walnut Creek)
/
Aminet - June 1993 [Walnut Creek].iso
/
usenet
/
sources
/
volume91
/
utilitys
/
less_14z
/
part02
< prev
next >
Wrap
Internet Message Format
|
1991-07-08
|
61KB
Path: news.larc.nasa.gov!amiga-request
From: amiga-request@ab20.larc.nasa.gov (Amiga Sources/Binaries Moderator)
Subject: v91i128: Less 1.4Z - text pager, Part02/07
Reply-To: rayz@altair.csustan.edu (R. L. Zarling)
Newsgroups: comp.sources.amiga
Message-ID: <comp.sources.amiga.v91i128@ab20.larc.nasa.gov>
References: <comp.sources.amiga.v91i127@ab20.larc.nasa.gov>
Date: 04 Jul 91 17:28:18 GMT
Approved: tadguy@uunet.UU.NET (Tad Guy)
X-Mail-Submissions-To: amiga@uunet.uu.net
X-Post-Discussions-To: comp.sys.amiga.misc
Submitted-by: rayz@altair.csustan.edu (R. L. Zarling)
Posting-number: Volume 91, Issue 128
Archive-name: utilities/less-1.4z/part02
#!/bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of archive 2 (of 7)."
# Contents: Less1.4Z/ReadMe Less1.4Z/src/ch.c Less1.4Z/src/option.c
# Less1.4Z/src/output.c Less1.4Z/src/version.c
# Wrapped by tadguy@ab20 on Thu Jul 4 13:28:15 1991
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'Less1.4Z/ReadMe' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'Less1.4Z/ReadMe'\"
else
echo shar: Extracting \"'Less1.4Z/ReadMe'\" \(8241 characters\)
sed "s/^X//" >'Less1.4Z/ReadMe' <<'END_OF_FILE'
XThis is a revision of a port (by Bob Leivian) of version 73 of the "Less"
Xpager from Unix (Fred Fish #149).
X
XLess is an Ascii text pager with the following features:
X
X -Compatible with WB 1.3 and 2.0 on any Amiga
X -Handles NTSC, PAL, overscan, etc. screens
X -Works with pipes (with a consenting shell or pipe: device)
X -Permits multiple file selection, CLI or Workbench
X -Forward & backward movement in a variety of ways
X -Powerful searches, using regular expression patterns
X -Handles alternative fonts
X -Handles international Ascii characters
X -Handles boldface, underline, etc. in ANSI or Unix nroff style
X -Customizable, using environment or command options
X -Residentable
X
XLess is still the only pager I know of on the Amiga that handles pipes
Xand multiple file selection. To me, these two features are essential
Xin a pager. If your shell supports pipes and expands wildcards (I use
XSteve Koren's outstanding SKsh), you can write things like 'ls | less'
Xor 'less *.readme'.
X
XLess has been around for a long time in the Unix world, and has been
Xported to the Amiga before. Unfortunately, the earlier Amiga port would
Xnot run on Amiga 3000s and was seriously crippled in the areas of support
Xfor non-NTSC or overscan screens and international characters.
X
XThe current version opens a full-sized window on your workbench screen
X(even PAL or overscan), and displays as much text from the input
Xfiles as it can using the standard system font. It is smart enough to
Xadjust these values even if you resize the window using the resizing
Xgadget. It responds to the standard window close gadget, and of course
Xfront/back, drag bar, and 2.0 zoom gadgets.
X
XYou can specify less than a full-sized window from the command line by
Xa new option, -[N,N,N,N]. The four N's are left-edge position, top-edge
Xposition, width, and height in pixels. Any may be omitted, defaulting
Xto 0. Zeros in the last two positions mean full width or height. If
Xnumbers at the end of the list are omitted, their preceding commas may
Xbe omitted also. If any of the Ns are negative, they are taken to be
Xrelative to the bottom right corner of the screen. Thus, [-200,-100,
X200,100] would be a 200 by 100 window in the bottom right corner of the
Xscreen, and [0,12,0,-100] would be a full-width window leaving the title
Xbar of the screen and the bottom 100 scan lines exposed. There is a
Xminimum window size, and if it is violated, or if the window would fall
Xoff the edges of the screen, Less simply forces things to conform.
X
XIt recognizes most ANSI commands to set underlining, italics, boldfacing,
Xor inverse video, in addition to the backspace protocols for boldfacing
Xand underlining that Less has always recognized (if neither of the two
X-u options is set).
X
XThis version of Less is more "Amigatised" in its use of the Amiga keyboard.
XIt allows you to scroll backward in the file by one line using the
Xbackspace key--a sort of logical consequence, IMHO, of the carriage
Xreturn key's use for scrolling forward by single lines. The arrow keys
X(cursor up, down, left and right) are active: up and down move you
Xthrough the document by pages; left and right by lines; shifted left
Xand right by half-pages. The HELP key displays a help message. I
Xhave added ^N and ^P for next and previous line, ^V for next page, ^S
Xfor forward search, and '<' and '>' for go to top and bottom of file, in
Xresponse to a request from an emacs-type.
X
XWorkbench support is expanded to handle multiple selection of files to
Xbe viewed. You cannot enter -options from workbench like you can from
XCLI, but Less *does* act upon whatever options are set in the environment
Xvariable LESS.
X
XLess version 1.4Z recognizes the international character set between
Xcharacters 160 and 255 (decimal).
X
XThe regular expression pattern matching in searches has been enabled.
XThese use the powerful Unix 'ed' style patterns. Any pattern consisting
Xonly of letters, numbers, and spaces will simply search for the given
Xpattern. But you can use one or more of the metacharacters [].^$()|*+ to
Xengineer very sophisticated searches. The '.' stands for any single
Xcharacter, and 'x*' stands for 0 or more occurances of x (so 'x.*y'
Xwould match anything that started with x and ended with y). 'x+'
Xworks the same way, for 1 or more occurances of x. 'x?' matches 0 or 1
Xoccurances of x (i.e. 'x' or nothing). '[abc]' matches any single
Xoccurance of 'a', 'b', or 'c'. '[^abc]' matches any single character
Xexcept 'a', 'b', or 'c'. '[a-m]' matches any single character in the
Xrange 'a' through 'm' inclusive. '^x' finds x only at the beginning of
Xa line; 'x$' only at the end of a line. 'x|y' matches either x or y. The
Xvarious pieces can be combined, of course, and grouped with parentheses.
X'([Aa]ny|[Ee]ach) +of you' would find any phrase beginning with 'any'
Xor 'each' (possibly capitalized) followed by one or more blanks, followed
Xby 'of you'. ' (can)?not ' matches either 'not' or 'cannot', but not
X'nothing' or 'cancel'. '[^a-zA-Z]i[^a-zA-Z]' finds all occurances of a
Xvariable 'i' in a program, but does not find 'i' embedded in other
Xvariable names or words. To match a metacharacter literally, precede it
Xwith a backslash; e.g. '\. \*' would match a period followed by two
Xspaces and an asterisk.
X
XWith resizeable windows, the number of lines to scroll for page-forward
Xand page-back commands is now recalculated each time the screen is
Xresized. The -z command now sets the maximum number of lines that will
Xbe scrolled for full-screen movement. The space bar, for instance, will
Xscroll either -z lines, or a full screen, whichever is less.
X
XHalf-page moves used to be fixed at 10 lines (although alterable
Xby prefixing a u or d command with a different number). With resizable
Xscreens, this didn't seem to make much sense any more, so I also have
XLess automatically compute the half-page size on startup and resizing of
Xthe window.
X
XMany bugs or unimplemented features have been fixed; they're generally
Xsmall things that casual users will never notice. The Q and q options
Xwork: they quiet the visible bell, since there is no audible bell. The
XE and e options have changed meaning slightly: You can exit a file upon
Xany attempted forward movement beyond eof (E), or only upon an attempted
Xfull-page movement (e, the default), or you can be barred from exiting
Xvia text movement commands (neither e nor E). The old business of closing
Xthe window immediately (old E) upon finding eof, before you have time to
Xread the last page of text, was judged useless in the Amiga environment!
XC was made the default for painting screens, for speed. This version
Xtakes greater pains to assure that the prompt at the bottom of the screen
Xfits in a single line; it is shortened if necessary. Some bug fixes have
Xmade it harder (I think!) to crash Less (no pun intended).
X
XSignal handling has been improved: ^C in the Less window will abort
Xsearches, but is otherwise ignored with a warning message. A BREAK
Xsignal from the launching CLI (^C in the CLI window, if there is one,
Xor AmigaDOS "break" command directed at Less) will immediately
Xterminate the process (with cleanup, of course). Error handling in
Xconnection with reading the files is much improved, with emphasis on
Xmore informative error messages.
X
XI removed two "features" of the old Amiga port: Less1.4Z no longer
Xinternally expands wildcarded filenames, and it no longer prints files
Xon the system printer. I think both of these functions are better done
Xby other means; e.g. SKsh or some other shell for wildcard expansion,
Xand copying to prt: or using one of the many printer utilities to get
Xprintouts. Less is a good pager; it doesn't need to be bogged down and
Xfattened up with random other capability. In any event, since I didn't
Xneed or want these functions, it seemed a lot easier to remove them
Xthan to rewrite them.
X
XThe "clean data" option of the original Unix no longer makes sense in
Xthis version, and has been deleted.
X
XLess1.4Z was compiled with SAS-C (formerly Lattice) v5.10a, using the
Xversion 2.0 include files.
X
X--------------------------------------------------------------
X
XRay Zarling
XCalifornia State Univ. Stanislaus
XTurlock, CA 95380
X
Xrayz@csustan.edu
END_OF_FILE
if test 8241 -ne `wc -c <'Less1.4Z/ReadMe'`; then
echo shar: \"'Less1.4Z/ReadMe'\" unpacked with wrong size!
fi
# end of 'Less1.4Z/ReadMe'
fi
if test -f 'Less1.4Z/src/ch.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'Less1.4Z/src/ch.c'\"
else
echo shar: Extracting \"'Less1.4Z/src/ch.c'\" \(12784 characters\)
sed "s/^X//" >'Less1.4Z/src/ch.c' <<'END_OF_FILE'
X/*
X * Low level character input from the input file.
X * We use these special purpose routines which optimize moving
X * both forward and backward from the current read pointer.
X */
X
X#ifdef AMIGA
X/* Compile with -HPreHeader.q to get "less.h"! */
X#else
X#include "less.h"
X#endif
X
X
X/* Prototypes for functions defined in ch.c */
X
Xstatic int fch_get __PROTO((void));
Xstatic int buffered __PROTO((long block));
X
X
Xpublic int file = -1; /* File descriptor of the input file */
X
X/*
X * Pool of buffers holding the most recently used blocks of the input file.
X */
X#define BUFSIZ 1024
Xstruct buf {
X struct buf *next, *prev;
X long block;
X char data[BUFSIZ];
X};
Xstatic struct buf *bufs = NULL;
Xpublic int nbufs;
X
X/*
X * The buffer pool is kept as a doubly-linked circular list,
X * in order from most- to least-recently used.
X * The circular list is anchored by buf_anchor.
X */
Xstatic struct {
X struct buf *next, *prev;
X} buf_anchor;
X#define END_OF_CHAIN ((struct buf *)&buf_anchor)
X#define buf_head buf_anchor.next
X#define buf_tail buf_anchor.prev
X
X/*
X * If we fail to allocate enough memory for buffers, we try to limp
X * along with a minimum number of buffers.
X */
X#define DEF_NBUFS 2 /* Minimum number of buffers */
X
X#ifndef AMIGA
Xextern int clean_data;
X#endif
Xextern int ispipe;
Xextern int sigs;
X
X#if LOGFILE
Xextern int logfile;
X#endif
X
X/*
X * Current position in file.
X * Stored as a block number and an offset into the block.
X */
Xstatic long ch_block;
Xstatic int ch_offset;
X
X/*
X * Length of file, needed if input is a pipe.
X */
Xstatic POSITION ch_fsize;
X
X/*
X * Largest block number read if input is standard input (a pipe).
X */
Xstatic long last_piped_block;
X
X/*
X * Get the character pointed to by the read pointer.
X * ch_get() is a macro which is more efficient to call
X * than fch_get (the function), in the usual case
X * that the block desired is at the head of the chain.
X */
X#define ch_get() ((buf_head->block == ch_block) ? \
X buf_head->data[ch_offset] : fch_get())
X
X#ifdef __STDC__
Xstatic int fch_get (void)
X#else
X static int
Xfch_get()
X#endif
X{
X register struct buf *bp;
X register int n;
X register int end;
X POSITION pos;
X
X /*
X * Look for a buffer holding the desired block.
X */
X for (bp = buf_head; bp != END_OF_CHAIN; bp = bp->next)
X if (bp->block == ch_block)
X goto found;
X /*
X * Block is not in a buffer.
X * Take the least recently used buffer
X * and read the desired block into it.
X */
X bp = buf_tail;
X bp->block = ch_block;
X pos = ch_block * BUFSIZ;
X if (ispipe)
X {
X /*
X * The block requested should be one more than
X * the last block read.
X */
X if (ch_block != ++last_piped_block)
X {
X /* This "should not happen". */
X char message[80];
X sprintf(message, "Pipe error: last %ld, want %ld\n",
X (long)last_piped_block-1, (long)ch_block);
X error(message);
X quit();
X }
X } else
X lseek(file, pos, 0);
X
X /*
X * Read the block. This may take several reads if the input
X * is coming from standard input, due to the nature of pipes.
X */
X end = 0;
X while ((n = read(file, &bp->data[end], BUFSIZ-end)) > 0)
X if ((end += n) >= BUFSIZ)
X break;
X
X if (n < 0)
X {
X error("read error");
X quit();
X }
X
X#if LOGFILE
X /*
X * If we have a log file, write this block to it.
X */
X if (logfile >= 0 && end > 0)
X write(logfile, bp->data, end);
X#endif
X
X /*
X * Set an EOF marker in the buffered data itself.
X * Then ensure the data is "clean": there are no
X * extra EOF chars in the data and that the "meta"
X * bit (the 0200 bit) is reset in each char.
X */
X if (end < BUFSIZ)
X {
X ch_fsize = pos + end;
X bp->data[end] = EOF;
X }
X
X#ifndef AMIGA
X if (!clean_data)
X#endif
X while (--end >= 0)
X {
X#ifdef EIGHTBIT
X /* We handle all 8-bit characters, except these,
X which are flags for special printing
X */
X switch ( bp->data[end] )
X {
X case UL_CHAR:
X case UE_CHAR:
X case BO_CHAR:
X case BE_CHAR:
X case IT_CHAR:
X case IE_CHAR:
X case NV_CHAR:
X case NE_CHAR:
X bp->data[end] = '\177';
X default:
X break;
X }
X#else
X#ifdef ANSIGR
X if ( (unsigned char)(bp->data[end]) != 0x9b )
X#endif
X bp->data[end] &= 0177;
X#endif
X if (bp->data[end] == EOF)
X bp->data[end] = '@';
X }
X
X found:
X /* if (buf_head != bp) {this is guaranteed by the ch_get macro} */
X {
X /*
X * Move the buffer to the head of the buffer chain.
X * This orders the buffer chain, most- to least-recently used.
X */
X bp->next->prev = bp->prev;
X bp->prev->next = bp->next;
X
X bp->next = buf_head;
X bp->prev = END_OF_CHAIN;
X buf_head->prev = bp;
X buf_head = bp;
X }
X return (int)(bp->data[ch_offset]);
X}
X
X#if LOGFILE
X/*
X * Close the logfile.
X * If we haven't read all of standard input into it, do that now.
X */
X public void
Xend_logfile()
X{
X static int tried;
X
X if (logfile < 0)
X return;
X if (!tried && ch_fsize == NULL_POSITION)
X {
X tried = 1;
X lower_left();
X clear_eol();
X so_enter();
X putstr("finishing logfile... (interrupt to abort)");
X so_exit();
X flush();
X while (sigs == 0 && ch_forw_get() != EOF)
X ;
X }
X close(logfile);
X logfile = -1;
X}
X#endif
X
X/*
X * Determine if a specific block is currently in one of the buffers.
X */
X#ifdef __STDC__
Xstatic int buffered (long block)
X#else
X static int
Xbuffered(block)
X long block;
X#endif
X{
X register struct buf *bp;
X
X for (bp = buf_head; bp != END_OF_CHAIN; bp = bp->next)
X if (bp->block == block)
X return (1);
X return (0);
X}
X
X/*
X * Seek to a specified position in the file.
X * Return 0 if successful, non-zero if can't seek there.
X */
X#ifdef __STDC__
Xint ch_seek (register POSITION pos)
X#else
X public int
Xch_seek(pos)
X register POSITION pos;
X#endif
X{
X long new_block;
X
X new_block = pos / BUFSIZ;
X if (!ispipe || new_block == last_piped_block + 1 || buffered(new_block))
X {
X /*
X * Set read pointer.
X */
X ch_block = new_block;
X ch_offset = pos % BUFSIZ;
X return (0);
X }
X return (1);
X}
X
X/*
X * Seek to the end of the file.
X */
X#ifdef __STDC__
Xint ch_end_seek (void)
X#else
X public int
Xch_end_seek()
X#endif
X{
X if (ispipe)
X {
X /*
X * Do it the slow way: read till end of data.
X */
X while (ch_forw_get() != EOF)
X ;
X } else
X {
X (void) ch_seek((POSITION)(lseek(file, (offset_t)0, 2)));
X }
X return (0);
X}
X
X/*
X * Seek to the beginning of the file, or as close to it as we can get.
X * We may not be able to seek there if input is a pipe and the
X * beginning of the pipe is no longer buffered.
X */
X#ifdef __STDC__
Xint ch_beg_seek (void)
X#else
X public int
Xch_beg_seek()
X#endif
X{
X register struct buf *bp, *firstbp;
X
X /*
X * Try a plain ch_seek first.
X */
X if (ch_seek((POSITION)0) == 0)
X return (0);
X
X /*
X * Can't get to position 0.
X * Look thru the buffers for the one closest to position 0.
X */
X firstbp = bp = buf_head;
X if (bp == END_OF_CHAIN)
X return (1);
X while ((bp = bp->next) != END_OF_CHAIN)
X if (bp->block < firstbp->block)
X firstbp = bp;
X ch_block = firstbp->block;
X ch_offset = 0;
X return (0);
X}
X
X/*
X * Return the length of the file, if known.
X */
X#ifdef __STDC__
XPOSITION ch_length (void)
X#else
X public POSITION
Xch_length()
X#endif
X{
X if (ispipe)
X return (ch_fsize);
X return ((POSITION)(lseek(file, (offset_t)0, 2)));
X}
X
X/*
X * Return the current position in the file.
X */
X#ifdef __STDC__
XPOSITION ch_tell (void)
X#else
X public POSITION
Xch_tell()
X#endif
X{
X return (ch_block * BUFSIZ + ch_offset);
X}
X
X/*
X * Get the current char and post-increment the read pointer.
X */
X#ifdef __STDC__
Xint ch_forw_get (void)
X#else
X public int
Xch_forw_get()
X#endif
X{
X register int c;
X
X c = ch_get();
X if (c != EOF && ++ch_offset >= BUFSIZ)
X {
X ch_offset = 0;
X ch_block ++;
X }
X return (c);
X}
X
X/*
X * Pre-decrement the read pointer and get the new current char.
X */
X#ifdef __STDC__
Xint ch_back_get (void)
X#else
X public int
Xch_back_get()
X#endif
X{
X register int c;
X
X if (--ch_offset < 0)
X {
X if (ch_block <= 0 || (ispipe && !buffered(ch_block-1)))
X {
X ch_offset = 0;
X return (EOF);
X }
X ch_offset = BUFSIZ - 1;
X ch_block--;
X }
X c = ch_get();
X return (c);
X}
X
X/*
X * Initialize the buffer pool to all empty.
X * Caller suggests that we use want_nbufs buffers.
X */
X#ifdef __STDC__
Xvoid ch_init (int want_nbufs)
X#else
X public void
Xch_init(want_nbufs)
X int want_nbufs;
X#endif
X{
X register struct buf *bp;
X#ifndef AMIGA
X char *calloc();
X#endif
X
X if (nbufs < want_nbufs)
X {
X /*
X * We don't have enough buffers.
X * Free what we have (if any) and allocate some new ones.
X */
X if (bufs != NULL)
X free((char *)bufs);
X bufs = (struct buf *) calloc(want_nbufs, sizeof(struct buf));
X nbufs = want_nbufs;
X if (bufs == NULL)
X {
X /*
X * Couldn't get that many.
X * Try for a small default number of buffers.
X */
X char message[80];
X sprintf(message,
X "Cannot allocate %d buffers. Using %d buffers.",
X nbufs, DEF_NBUFS);
X error(message);
X bufs = (struct buf *) calloc(DEF_NBUFS, sizeof(struct buf));
X nbufs = DEF_NBUFS;
X if (bufs == NULL)
X {
X /*
X * Couldn't even get the smaller number of bufs.
X * Something is wrong here, don't continue.
X */
X sprintf(message,
X "Cannot even allocate %d buffers! Quitting.",
X DEF_NBUFS);
X error(message);
X quit();
X /*NOTREACHED*/
X }
X }
X }
X
X /*
X * Initialize the buffers to empty.
X * Set up the circular list.
X */
X for (bp = &bufs[0]; bp < &bufs[nbufs]; bp++)
X {
X bp->next = bp + 1;
X bp->prev = bp - 1;
X bp->block = (long)(-1);
X }
X bufs[0].prev = bufs[nbufs-1].next = END_OF_CHAIN;
X buf_head = &bufs[0];
X buf_tail = &bufs[nbufs-1];
X last_piped_block = -1;
X ch_fsize = NULL_POSITION;
X (void) ch_seek((POSITION)0);
X}
END_OF_FILE
if test 12784 -ne `wc -c <'Less1.4Z/src/ch.c'`; then
echo shar: \"'Less1.4Z/src/ch.c'\" unpacked with wrong size!
fi
# end of 'Less1.4Z/src/ch.c'
fi
if test -f 'Less1.4Z/src/option.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'Less1.4Z/src/option.c'\"
else
echo shar: Extracting \"'Less1.4Z/src/option.c'\" \(16082 characters\)
sed "s/^X//" >'Less1.4Z/src/option.c' <<'END_OF_FILE'
X/*
X * Process command line options.
X * Each option is a single letter which controls a program variable.
X * The options have defaults which may be changed via
X * the command line option, or toggled via the "-" command.
X */
X
X#ifdef AMIGA
X/* Compile with -HPreHeader.q to get "less.h"! */
X#else
X#include "less.h"
X#endif
X
X
X#ifdef AMIGA
X/* use the old-style toupper() that doesn't check its arguement */
X#undef toupper
X#define toupper(c) ((c)-'a'+'A')
X#endif
X
X#define END_OPTION_STRING ('$')
X
X/*
X * Types of options.
X */
X#define BOOL 01 /* Boolean option: 0 or 1 */
X#define TRIPLE 02 /* Triple-valued option: 0, 1 or 2 */
X#define NUMBER 04 /* Numeric option */
X#define REPAINT 040 /* Repaint screen after toggling option */
X#define NO_TOGGLE 0100 /* Option cannot be toggled with "-" cmd */
X
X/* Prototypes for functions defined in option.c */
X
Xstatic char *optstring __PROTO((char *s));
Xstatic int getnum __PROTO((char **sp, int c));
X
X
X/*
X * Variables controlled by command line options.
X */
Xpublic int p_nbufs, f_nbufs; /* Number of buffers. There are two values,
X one used for input from a pipe and
X the other for input from a file. */
X#ifndef AMIGA
Xpublic int clean_data; /* Can we assume the data is "clean"?
X (That is, free of nulls, etc) */
X#endif
Xpublic int quiet; /* Should we suppress the audible bell? */
Xpublic int top_search; /* Should forward searches start at the top
X of the screen? (alternative is bottom) */
Xpublic int top_scroll; /* Repaint screen from top?
X (alternative is scroll from bottom) */
Xpublic int pr_type; /* Type of prompt (short, medium, long) */
Xpublic int bs_mode; /* How to process backspaces */
X#ifdef DUMBTERM
Xpublic int know_dumb; /* Don't complain about dumb terminals */
X#endif
Xpublic int quit_at_eof; /* Quit after hitting end of file twice */
Xpublic int squeeze; /* Squeeze multiple blank lines into one */
Xpublic int tabstop; /* Tab settings */
Xpublic int back_scroll; /* Repaint screen on backwards movement */
Xpublic int twiddle; /* Display "~" for lines after EOF */
X
Xextern char *prproto[];
Xextern int nbufs;
Xextern int sc_window;
X#ifdef AMIGA
Xpublic int scroll;
Xpublic int sc_window_spec; /* user's requested -z */
Xextern int Wind_Spec[4]; /* User-specified window size/position */
X#endif
Xextern char *first_cmd;
Xextern char *every_first_cmd;
X#if LOGFILE
Xextern char *namelogfile;
Xextern int force_logfile;
X#endif
X
X#define DEF_F_NBUFS 5 /* Default for f_nbufs */
X#define DEF_P_NBUFS 12 /* Default for p_nbufs */
X
Xstatic struct option
X{
X char oletter; /* The controlling letter (a-z) */
X char otype; /* Type of the option */
X int odefault; /* Default value */
X int *ovar; /* Pointer to the associated variable */
X char *odesc[3]; /* Description of each value */
X} option[] =
X{
X { 'c', TRIPLE, 2, &top_scroll,
X { "Repaint by scrolling from bottom of screen",
X "Repaint by clearing each line",
X "Repaint by painting from top of screen"
X }
X },
X#ifdef DUMBTERM
X { 'd', BOOL|NO_TOGGLE, 0, &know_dumb,
X { NULL, NULL, NULL}
X },
X#endif
X { 'e', TRIPLE, 1, &quit_at_eof,
X { "Don't quit at end-of-file",
X#ifdef AMIGA
X "Space bar quits at end-of-file",
X "Quit at end-of-file"
X#else
X "Quit at end-of-file",
X "Quit immediately at end-of-file"
X#endif
X }
X },
X#ifndef AMIGA
X { 'f', BOOL, 0, &clean_data,
X { "Don't assume data is clean",
X "Assume data is clean",
X NULL
X }
X },
X#endif
X { 'h', NUMBER, -1, &back_scroll, /* default set at window open */
X { "Backwards scroll limit is %d lines",
X NULL, NULL
X }
X },
X { 'm', TRIPLE, 1, &pr_type,
X { "Short prompt",
X "Medium prompt",
X "Long prompt"
X }
X },
X { 'q', TRIPLE, 0, &quiet,
X { "Ring the bell for errors AND at eof/bof",
X "Ring the bell for errors but not at eof/bof",
X "Never ring the bell"
X }
X },
X { 's', BOOL|REPAINT, 0, &squeeze,
X { "Don't squeeze multiple blank lines",
X "Squeeze multiple blank lines",
X NULL
X }
X },
X { 't', BOOL, 1, &top_search,
X { "Forward search starts from bottom of screen",
X "Forward search starts from top of screen",
X NULL
X }
X },
X { 'u', TRIPLE|REPAINT, 0, &bs_mode,
X
X { "Underlined text displayed in underline mode",
X "Backspaces cause overstrike",
X "Backspaces print as ^H"
X }
X },
X { 'w', BOOL|REPAINT, 1, &twiddle,
X { "Display nothing for lines after end-of-file",
X "Display ~ for lines after end-of-file",
X NULL
X }
X },
X { 'x', NUMBER|REPAINT, 8, &tabstop,
X { "Tab stops every %d spaces",
X NULL, NULL
X }
X },
X { 'z', NUMBER|REPAINT, -1, &sc_window,
X { "Scroll window size is %d lines",
X NULL, NULL
X }
X },
X { '\0' }
X};
X
Xpublic char all_options[64]; /* List of all valid options */
X
X/*
X * Initialize each option to its default value.
X */
X#ifdef __STDC__
Xvoid init_option (void)
X#else
X public void
Xinit_option()
X#endif
X{
X register struct option *o;
X register char *p;
X
X /*
X * First do special cases, not in option table.
X */
X first_cmd = every_first_cmd = NULL;
X f_nbufs = DEF_F_NBUFS; /* -bf */
X p_nbufs = DEF_P_NBUFS; /* -bp */
X
X p = all_options;
X *p++ = 'b';
X
X for (o = option; o->oletter != '\0'; o++)
X {
X /*
X * Set each variable to its default.
X * Also make a list of all options, in "all_options".
X */
X *(o->ovar) = o->odefault;
X *p++ = o->oletter;
X if (o->otype & TRIPLE)
X *p++ = toupper(o->oletter);
X }
X *p = '\0';
X}
X
X/*
X * Toggle command line flags from within the program.
X * Used by the "-" command.
X */
X#ifdef __STDC__
Xvoid toggle_option (char *s)
X#else
X public void
Xtoggle_option(s)
X char *s;
X#endif
X{
X int c;
X register struct option *o;
X char *msg;
X int n;
X int dorepaint;
X char message[100];
X char buf[5];
X
X c = *s++;
X
X /*
X * First check for special cases not handled by the option table.
X */
X switch (c)
X {
X case 'b':
X sprintf(message, "%d buffers", nbufs);
X error(message);
X return;
X }
X
X msg = NULL;
X for (o = option; o->oletter != '\0'; o++)
X {
X if (o->otype & NO_TOGGLE)
X continue;
X dorepaint = (o->otype & REPAINT);
X if ((o->otype & BOOL) && (o->oletter == c))
X {
X /*
X * Boolean option:
X * just toggle it.
X */
X *(o->ovar) = ! *(o->ovar);
X } else if ((o->otype & TRIPLE) && (o->oletter == c))
X {
X /*
X * Triple-valued option with lower case letter:
X * make it 1 unless already 1, then make it 0.
X */
X *(o->ovar) = (*(o->ovar) == 1) ? 0 : 1;
X } else if ((o->otype & TRIPLE) && (toupper(o->oletter) == c))
X {
X /*
X * Triple-valued option with upper case letter:
X * make it 2 unless already 2, then make it 0.
X */
X *(o->ovar) = (*(o->ovar) == 2) ? 0 : 2;
X } else if ((o->otype & NUMBER) && (o->oletter == c))
X {
X n = getnum(&s, '\0');
X if (n < 0)
X {
X /*
X * No number; just a query.
X * No need to repaint screen.
X */
X dorepaint = 0;
X } else
X {
X /*
X * Number follows the option letter.
X * Set the variable to that number.
X */
X *(o->ovar) = n;
X#ifdef AMIGA
X if ( c == 'z' )
X {
X sc_window_spec = sc_window;
X set_scroll();
X }
X#endif
X }
X sprintf(message, o->odesc[0],
X (o->ovar == &back_scroll) ?
X get_back_scroll() : *(o->ovar));
X msg = message;
X } else
X continue;
X
X
X if (dorepaint)
X repaint();
X if (msg == NULL)
X msg = o->odesc[*(o->ovar)];
X error(msg);
X return;
X }
X
X if (control_char(c))
X sprintf(buf, "^%c", carat_char(c));
X else
X sprintf(buf, "%c", c);
X sprintf(message, "\"-%s\": no such flag. Use one of \"%s\"",
X buf, all_options);
X error(message);
X}
X
X/*
X * Scan to end of string or to an END_OPTION_STRING character.
X * In the latter case, replace the char with a null char.
X * Return a pointer to the remainder of the string, if any.
X */
X#ifdef __STDC__
Xstatic char *optstring (char *s)
X#else
X static char *
Xoptstring(s)
X char *s;
X#endif
X{
X register char *p;
X
X for (p = s; *p != '\0'; p++)
X if (*p == END_OPTION_STRING)
X {
X *p = '\0';
X return (p+1);
X }
X return (p);
X}
X
X/*
X * Scan an argument (either from command line or from LESS environment
X * variable) and process it.
X */
X#ifdef __STDC__
Xvoid scan_option (char *s)
X#else
X public void
Xscan_option(s)
X char *s;
X#endif
X{
X register struct option *o;
X register int c;
X char message[80];
X
X if (s == NULL)
X return;
X
X next:
X if (*s == '\0')
X {
X sc_window_spec = sc_window;
X return;
X }
X switch (c = *s++)
X {
X case '-':
X case ' ':
X case '\t':
X case END_OPTION_STRING:
X goto next;
X case '+':
X if (*s == '+')
X every_first_cmd = ++s;
X first_cmd = s;
X s = optstring(s);
X goto next;
X case 'P':
X switch (*s)
X {
X case 'm': prproto[PR_MEDIUM] = ++s; break;
X case 'M': prproto[PR_LONG] = ++s; break;
X default: prproto[PR_SHORT] = s; break;
X }
X s = optstring(s);
X goto next;
X#if LOGFILE
X case 'L':
X force_logfile = 1;
X /* fall thru */
X case 'l':
X namelogfile = s;
X s = optstring(s);
X goto next;
X#endif
X case 'b':
X switch (*s)
X {
X case 'f':
X s++;
X f_nbufs = getnum(&s, 'b');
X break;
X case 'p':
X s++;
X p_nbufs = getnum(&s, 'b');
X break;
X default:
X f_nbufs = p_nbufs = getnum(&s, 'b');
X break;
X }
X goto next;
X case '0': case '1': case '2': case '3': case '4':
X case '5': case '6': case '7': case '8': case '9':
X {
X /*
X * Handle special "more" compatibility form "-number"
X * to set the scrolling window size.
X */
X s--;
X sc_window = getnum(&s, '-');
X goto next;
X }
X#ifdef AMIGA
X case '[': /* window specifier */
X {
X int i, rel;
X
X for (i = 0; i < 4; i++)
X {
X rel = 1;
X while ( *s == ' ' ) s++;
X if ( *s == ',' )
X { s++; continue; }
X if ( *s == '-' )
X { s++; rel = -1; }
X if ( *s == ']' || *s == '\0' ) break;
X Wind_Spec[i] = rel * getnum ( &s, s[-1] );
X if ( *s == ',' ) s++;
X }
X if ( *s++ != ']' )
X {
X error ("Invalid window specification");
X quit();
X }
X goto next;
X }
X#endif
X }
X
X for (o = option; o->oletter != '\0'; o++)
X {
X if ((o->otype & BOOL) && (o->oletter == c))
X {
X *(o->ovar) = ! o->odefault;
X goto next;
X } else if ((o->otype & TRIPLE) && (o->oletter == c))
X {
X *(o->ovar) = (o->odefault == 1) ? 0 : 1;
X goto next;
X } else if ((o->otype & TRIPLE) && (toupper(o->oletter) == c))
X {
X *(o->ovar) = (o->odefault == 2) ? 0 : 2;
X goto next;
X } else if ((o->otype & NUMBER) && (o->oletter == c))
X {
X *(o->ovar) = getnum(&s, c);
X goto next;
X }
X }
X
X sprintf(message, "\"-%c\": invalid flag", c);
X error(message);
X quit();
X}
X
X/*
X * Translate a string into a number.
X * Like atoi(), but takes a pointer to a char *, and updates
X * the char * to point after the translated number.
X */
X#ifdef __STDC__
Xstatic int getnum (char **sp, int c)
X#else
X static int
Xgetnum(sp, c)
X char **sp;
X int c;
X#endif
X{
X register char *s;
X register int n;
X char message[80];
X
X s = *sp;
X if (*s < '0' || *s > '9')
X {
X if (c == '\0')
X return (-1);
X#ifdef AMIGA
X sprintf(message,
X "number is required in option after '%c'", c);
X#else
X sprintf(message, "number is required after -%c", c);
X#endif
X error(message);
X quit();
X }
X
X n = 0;
X while (*s >= '0' && *s <= '9')
X n = 10 * n + *s++ - '0';
X *sp = s;
X return (n);
X}
END_OF_FILE
if test 16082 -ne `wc -c <'Less1.4Z/src/option.c'`; then
echo shar: \"'Less1.4Z/src/option.c'\" unpacked with wrong size!
fi
# end of 'Less1.4Z/src/option.c'
fi
if test -f 'Less1.4Z/src/output.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'Less1.4Z/src/output.c'\"
else
echo shar: Extracting \"'Less1.4Z/src/output.c'\" \(8986 characters\)
sed "s/^X//" >'Less1.4Z/src/output.c' <<'END_OF_FILE'
X/*
X * High level routines dealing with the output to the screen.
X */
X
X#ifdef AMIGA
X/* Compile with -HPreHeader.q to get "less.h"! */
X#else
X#include "less.h"
X#endif
X
X
Xpublic int errmsgs; /* Count of messages displayed by error() */
X
Xextern int sigs;
Xextern int sc_width, sc_height;
Xextern int ul_width, ue_width;
Xextern int so_width, se_width;
Xextern int bo_width, be_width;
X#ifdef AMIGA
Xextern int it_width, ie_width;
Xextern int nv_width, ne_width;
Xextern int nrow; /* vertical screen size */
X#endif
X#ifdef EIGHTBIT
Xextern int bs_mode;
X#endif
Xextern int tabstop;
Xextern int twiddle;
Xextern int any_display;
Xextern char *line;
Xextern char *first_cmd;
X
X/*
X * Display the line which is in the line buffer.
X */
X#ifdef __STDC__
Xvoid put_line (void)
X#else
X public void
Xput_line()
X#endif
X{
X#ifdef AMIGA
X register unsigned char *p;
X#else
X register char *p;
X#endif
X register int c;
X register int column;
X extern int auto_wrap, ignaw;
X
X if (sigs)
X /*
X * Don't output if a signal is pending.
X */
X return;
X
X if (line == NULL)
X line = (twiddle) ? "~" : "";
X
X column = 0;
X#ifdef AMIGA
X for (p = (unsigned char *)line; *p != '\0'; p++)
X#else
X for (p = line; *p != '\0'; p++)
X#endif
X {
X switch (c = *p)
X {
X case UL_CHAR:
X ul_enter();
X column += ul_width;
X break;
X case UE_CHAR:
X ul_exit();
X column += ue_width;
X break;
X case BO_CHAR:
X bo_enter();
X column += bo_width;
X break;
X case BE_CHAR:
X bo_exit();
X column += be_width;
X break;
X#ifdef AMIGA
X case IT_CHAR:
X it_enter();
X column += it_width;
X break;
X case IE_CHAR:
X it_exit();
X column += ie_width;
X break;
X case NV_CHAR:
X nv_enter();
X column += nv_width;
X break;
X case NE_CHAR:
X nv_exit();
X column += ne_width;
X break;
X#endif
X case '\t':
X do
X {
X putchr(' ');
X column++;
X } while ((column % tabstop) != 0);
X break;
X case '\b':
X#ifdef EIGHTBIT
X if (bs_mode == BS_CONTROL)
X {
X putchr('^');
X putchr(carat_char(c));
X column += 2;
X break;
X }
X#endif
X putbs();
X column--;
X break;
X default:
X#ifdef EIGHTBIT
X /* Control characters are still control
X * characters. Replace them with some-
X * thing printable.
X */
X if (control_char(c))
X {
X putchr('^');
X putchr(carat_char(c));
X column += 2;
X }
X#else
X if (c & 0200)
X {
X /*
X * Control characters arrive here as the
X * normal character [carat_char(c)] with
X * the 0200 bit set. See pappend().
X */
X putchr('^');
X putchr(c & 0177);
X column += 2;
X }
X#endif
X else
X {
X putchr(c);
X column++;
X }
X }
X }
X if (column < sc_width || !auto_wrap || ignaw)
X putchr('\n');
X}
X
X/*
X * Is a given character a "control" character?
X * {{ ASCII DEPENDENT }}
X */
X#ifdef __STDC__
Xint control_char (int c)
X#else
X public int
Xcontrol_char(c)
X int c;
X#endif
X{
X#ifdef EIGHTBIT
X /* SAS says 0xff is a control character, for some reason */
X return iscntrl(c) && c != 0xff;
X#else
X return ( c < ' ' || c == '\177' );
X#endif
X}
X
X/*
X * Return the printable character used to identify a control character
X * (printed after a carat; e.g. '\3' => "^C").
X * {{ ASCII DEPENDENT }}
X */
X#ifdef __STDC__
Xint carat_char (int c)
X#else
X public int
Xcarat_char(c)
X int c;
X#endif
X{
X return ((c == '\177') ? '?' : (c | 0100));
X}
X
X
Xstatic char obuf[1024];
Xstatic char *ob = obuf;
X
X/*
X * Flush buffered output.
X */
X#ifdef __STDC__
Xvoid flush (void)
X#else
X public void
Xflush()
X#endif
X{
X#ifdef AMIGA
X ttwrite ( obuf, (long) (ob-obuf));
X#else
X write(1, obuf, ob-obuf);
X#endif
X ob = obuf;
X}
X
X/*
X * Discard buffered output.
X */
X#ifdef __STDC__
Xvoid dropout (void)
X#else
X public void
Xdropout()
X#endif
X{
X ob = obuf;
X}
X
X/*
X * Output a character.
X */
X#ifdef __STDC__
Xvoid putchr (int c)
X#else
X public void
Xputchr(c)
X int c;
X#endif
X{
X if (ob >= &obuf[sizeof(obuf)])
X flush();
X *ob++ = c;
X}
X
X/*
X * Output a string.
X */
X#ifdef __STDC__
Xvoid putstr (register char *s)
X#else
X public void
Xputstr(s)
X register char *s;
X#endif
X{
X while (*s != '\0')
X putchr(*s++);
X}
X
X/*
X * Output a message in the lower left corner of the screen
X * and wait for carriage return.
X */
X
Xstatic char return_to_continue[] = " (press RETURN)";
X
X#ifdef __STDC__
Xvoid error (char *s)
X#else
X public void
Xerror(s)
X char *s;
X#endif
X{
X register int c;
X static char buf[2];
X
X errmsgs++;
X#ifdef AMIGA
X /* nrow tells us if the window has been opened yet.
X any_display tells us if we have initialized reading a file yet.
X If either of these are false, trying to write to the screen
X now will cause trouble, either immediately or when we try to
X regenerate a non-existant display.
X */
X if ( nrow < 2 || !any_display )
X#else
X if (!any_display)
X#endif
X {
X /*
X * Nothing has been displayed yet.
X * Output this message on error output (file
X * descriptor 2) and don't wait for a keystroke
X * to continue.
X *
X * This has the desirable effect of producing all
X * error messages on error output if standard output
X * is directed to a file. It also does the same if
X * we never produce any real output; for example, if
X * the input file(s) cannot be opened. If we do
X * eventually produce output, code in edit() makes
X * sure these messages can be seen before they are
X * overwritten or scrolled away.
X */
X#ifdef AMIGA
X /* If the window is too small, s may be NULL on Amiga */
X if ( s )
X MyRequester( s );
X else
X MyRequester ( "Error" );
X#else
X write(2, s, strlen(s));
X write(2, "\n", 1);
X#endif
X return;
X }
X
X lower_left();
X clear_eol();
X so_enter();
X#ifdef AMIGA
X if ( s )
X#endif
X putstr(s);
X putstr(return_to_continue);
X so_exit();
X
X#if ONLY_RETURN
X while ((c = getchr()) != '\n' && c != '\r')
X bell();
X#else
X c = getchr();
X if (c != '\n' && c != '\r' && c != ' ')
X {
X buf[0] = c;
X first_cmd = buf;
X }
X#endif
X lower_left();
X
X#ifdef AMIGA
X if ( s &&
X strlen(s) + sizeof(return_to_continue) +
X so_width + se_width + 1 > sc_width
X )
X#else
X if (strlen(s) + sizeof(return_to_continue) +
X so_width + se_width + 1 > sc_width)
X#endif
X /*
X * Printing the message has probably scrolled the screen.
X * {{ Unless the terminal doesn't have auto margins,
X * in which case we just hammered on the right margin. }}
X */
X repaint();
X
X flush();
X}
END_OF_FILE
if test 8986 -ne `wc -c <'Less1.4Z/src/output.c'`; then
echo shar: \"'Less1.4Z/src/output.c'\" unpacked with wrong size!
fi
# end of 'Less1.4Z/src/output.c'
fi
if test -f 'Less1.4Z/src/version.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'Less1.4Z/src/version.c'\"
else
echo shar: Extracting \"'Less1.4Z/src/version.c'\" \(8918 characters\)
sed "s/^X//" >'Less1.4Z/src/version.c' <<'END_OF_FILE'
X#ifdef AMIGA
X/* Compile with -HPreHeader.q to get "less.h"! */
X#else
X#include "less.h"
X#endif
X
X/*
X * less
X * Copyright (c) 1984,1985 Mark Nudelman
X *
X * This program may be freely used and/or modified,
X * with the following provisions:
X * 1. This notice and the above copyright notice must remain intact.
X * 2. Neither this program, nor any modification of it,
X * may be sold for profit without written consent of the author.
X *
X * -----------------------------------------------------------------
X *
X * This program is a paginator similar to "more",
X * but allows you to move both forward and backward in the file.
X * Commands are based on "more" and "vi".
X *
X * ----------------------- CHANGES ---------------------------------
X *
X * Allowed use on standard input 1/29/84 markn
X * Added E, N, P commands 2/1/84 markn
X * Added '=' command, 'stop' signal handling 4/17/84 markn
X * Added line folding 4/20/84 markn
X * v2: Fixed '=' command to use BOTTOM_PLUS_ONE,
X * instead of TOP, added 'p' & 'v' commands 4/27/84 markn
X * v3: Added -m and -t options, '-' command 5/3/84 markn
X * v4: Added LESS environment variable 5/3/84 markn
X * v5: New comments, fixed '-' command slightly 5/3/84 markn
X * v6: Added -Q, visual bell 5/15/84 markn
X * v7: Fixed jump_back(n) bug: n should count real
X * lines, not folded lines. Also allow number
X * on G command. 5/24/84 markn
X * v8: Re-do -q and -Q commands 5/30/84 markn
X * v9: Added "+<cmd>" argument 9/25/84 markn
X * v10: Fixed bug in -b<n> argument processing 10/10/84 markn
X * v11: Made error() ring bell if \n not entered. 10/18/84 markn
X * -----------------------------------------------------------------
X * v12: Reorganized signal handling and made
X * portable to 4.2bsd. 2/13/85 mark
X * v13: Reword error message for '-' command. 2/16/85 mark
X * v14: Added -bf and -bp variants of -b. 2/22/85 mark
X * v15: Miscellaneous changes. 2/25/85 mark
X * v16: Added -u flag for backspace processing. 3/13/85 mark
X * v17: Added j and k commands,
X * changed -t default. 4/13/85 mark
X * v18: Rewrote signal handling code. 4/20/85 mark
X * v19: Got rid of "verbose" eq_message(). 5/2/85 mark
X * Made search() scroll in some cases.
X * v20: Fixed screen.c ioctls for System V. 5/21/85 mark
X * v21: Fixed some first_cmd bugs. 5/23/85 mark
X * v22: Added support for no RECOMP nor REGCMP. 5/24/85 mark
X * v23: Miscellanous changes and prettying up. 5/25/85 mark
X * Posted to USENET.
X * v24: Added ti,te terminal init & de-init 6/3/85 Mike Kersenbrock
X * v25: Added -U flag, standout mode underlining. 6/8/85 mark
X * v26: Added -M flag. 6/9/85 mark
X * Use underline termcap (us) if it exists.
X * v27: Renamed some variables to make unique in 6/15/85 mark
X * 6 chars. Minor fix to -m.
X * v28: Fixed right margin bug. 6/28/85 mark
X * v29: Incorporated M.Rose's changes to signal.c 6/28/85 mark
X * v30: Fixed stupid bug in argument processing. 6/29/85 mark
X * v31: Added -p flag, changed repaint algorithm. 7/15/85 mark
X * Added kludge for magic cookie terminals.
X * v32: Added cat_file if output not a tty. 7/16/85 mark
X * v33: Added -e flag and EDITOR. 7/23/85 mark
X * v34: Added -s flag. 7/26/85 mark
X * v35: Rewrote option handling; added option.c. 7/27/85 mark
X * v36: Fixed -e flag to work if not last file. 7/29/85 mark
X * v37: Added -x flag. 8/10/85 mark
X * v38: Changed prompting; created prompt.c. 8/19/85 mark
X * v39: (Not -p) does not initially clear screen. 8/24/85 mark
X * v40: Added "skipping" indicator in forw(). 8/26/85 mark
X * Posted to USENET.
X * v41: ONLY_RETURN, control char commands, 9/17/85 mark
X * faster search, other minor fixes.
X * v42: Added ++ command line syntax; 9/25/85 mark
X * ch_fsize for pipes.
X * v43: Added -h flag, changed prim.c algorithms. 10/15/85 mark
X * v44: Made END print in all cases of eof; 10/16/85 mark
X * ignore SIGTTOU after receiving SIGTSTP.
X * v45: Never print backspaces unless -u. 10/16/85 mark
X * v46: Backwards scroll in jump_loc. 10/24/85 mark
X * v47: Fixed bug in edit(): *first_cmd==0 10/30/85 mark
X * v48: Use TIOCSETN instead of TIOCSETP. 11/16/85 mark
X * Added marks (m and ' commands).
X * Posted to USENET.
X * -----------------------------------------------------------------
X * v49: Fixed bug: signal didn't clear mcc. 1/9/86 mark
X * v50: Added ' (quote) to gomark. 1/15/86 mark
X * v51: Added + cmd, fixed problem if first_cmd
X * fails, made g cmd sort of "work" on pipes
X * even if bof is no longer buffered. 1/16/86 mark
X * v52: Made short files work better. 1/17/86 mark
X * v53: Added -P option. 1/20/86 mark
X * v54: Changed help to use HELPFILE. 1/20/86 mark
X * v55: Messages work better if not tty output. 1/23/86 mark
X * v56: Added -l option. 1/24/86 mark
X * v57: Fixed -l to get confirmation before
X * overwriting an existing file. 1/31/86 mark
X * v58: Added filename globbing. 8/28/86 mark
X * v59: Fixed some bugs with very long filenames. 9/15/86 mark
X * v60: Incorporated changes from Leith (Casey)
X * Leedom for boldface and -z option. 9/26/86 mark
X * v61: Got rid of annoying repaints after ! cmd. 9/26/86 mark
X * Posted to USENET.
X * -----------------------------------------------------------------
X * v62: Added is_directory(); change -z default to
X * -1 instead of 24; cat-and-exit if -e and
X * file is less than a screenful. 12/23/86 mark
X * v63: Fixed bug in cat-and-exit if > 1 file. 1/8/87 mark
X * v64: Changed puts/putstr, putc/putchr,
X * getc/getchr to avoid name conflict with
X * stdio functions. 1/12/87 mark
X * v65: Allowed '-' command to change NUMBER
X * valued options (thanks to Gary Puckering) 1/26/87 mark
X * v66: Fixed bug: prepaint should use force=1. 2/13/87 mark
X * v67: Added !! and % expansion to ! command. 2/24/87 mark
X * v68: Added SIGWINCH and TIOCGWINSZ support;
X * changed is_directory to bad_file.
X * (thanks to J. Robert Ward) 2/25/87 mark
X * v69: Added SIGWIND and WIOCGETD (for Unix PC). 2/25/87 mark
X * v70: Changed help cmd from 'h' to 'H'; better
X * error msgs in bad_file, errno_message. 3/13/87 mark
X * v71: Changed -p to -c, made triple -c/-C
X * for clear-eol like more's -c. 5/11/87 mark
X * v72: Added -E, -L, use $SHELL in lsystem(). 6/26/87 mark
X * (thanks to Steve Spearman)
X * v73: Allow Examine "#" for previous file. 6/26/87 mark
X * Posted to USENET 8/25/87.
X * -----------------------------------------------------------------
X * Amiga ports:
X * (Any history previous to 1.3 lost)
X * 1.3: Original? port to Amiga by Bob Leivian ???
X * 1.3Z: Bugs fixed to run under AmigaDos 1.3 and 6/01/91 rlz
X * 2.0 on all Amiga models through A3000.
X * Determines size of full screen workbench
X * window, and handles whatever size it gets
X * and whatever font. Permits window resizing,
X * close gadget. Recognizes Amiga ANSI
X * graphic rendition codes.
X * 1.4Z: Several bugs fixed. Error handling 6/08/91 rlz
X * much improved. Made residentable.
X * User-specifiable window size/placement.
X * Recognizes international character set
X * characters 160 - 255 (decimal). Regular
X * expression searches added.
X */
X
Xchar version[] =
X"@(#)Amiga Less 1.4Z (ported from Unix version 73)";
END_OF_FILE
if test 8918 -ne `wc -c <'Less1.4Z/src/version.c'`; then
echo shar: \"'Less1.4Z/src/version.c'\" unpacked with wrong size!
fi
# end of 'Less1.4Z/src/version.c'
fi
echo shar: End of archive 2 \(of 7\).
cp /dev/null ark2isdone
MISSING=""
for I in 1 2 3 4 5 6 7 ; do
if test ! -f ark${I}isdone ; then
MISSING="${MISSING} ${I}"
fi
done
if test "${MISSING}" = "" ; then
echo You have unpacked all 7 archives.
rm -f ark[1-9]isdone
else
echo You still need to unpack the following archives:
echo " " ${MISSING}
fi
## End of shell archive.
exit 0
--
Mail submissions (sources or binaries) to <amiga@uunet.uu.net>.
Mail comments to the moderator at <amiga-request@uunet.uu.net>.
Post requests for sources, and general discussion to comp.sys.amiga.misc.